<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../plugins/vue.min.js"></script>
</head>
<style>
    .red{
        background-color: red;
    }
</style>
<body>
    <div class="one">
    <ul>
        <!-- 点击那一个,那一个变色 -->
        <li v-for="(data,index) in list" :class="index==current?'red':''" @click="changeClass(index)">
            {{data}}
        </li>
    </ul>
</div>

    <script>
        let mm = new Vue({
            el:'.one',
            data:{
                list:['11','22','33'],
                current: -1
            },
            methods:{
                changeClass(index){
                    this.current = index
                }
            }
        
        })
    </script>
</body>
</html>